<template>
	<view class="order-section">
		<view class="section-header">
			<text class="title">我的订单</text>
			<view class="more" @tap="navigateToOrderList">
				<text>全部订单</text>
				<text class="arrow">></text>
			</view>
		</view>
		<view class="order-types">
			<view class="type-item" @tap="navigateToOrderList('unpaid')">
				<image src="/static/images/order/unpaid.svg" mode="aspectFit" class="type-icon"></image>
				<text>待付款</text>
			</view>
			<view class="type-item" @tap="navigateToOrderList('unshipped')">
				<image src="/static/images/order/unshipped.svg" mode="aspectFit" class="type-icon"></image>
				<text>待发货</text>
			</view>
			<view class="type-item" @tap="navigateToOrderList('shipped')">
				<image src="/static/images/order/shipped.svg" mode="aspectFit" class="type-icon"></image>
				<text>待收货</text>
			</view>
			<view class="type-item" @tap="navigateToOrderList('completed')">
				<image src="/static/images/order/completed.svg" mode="aspectFit" class="type-icon"></image>
				<text>已完成</text>
			</view>
		</view>
	</view>
</template>

<script setup>
const navigateToOrderList = (type = '') => {
	uni.navigateTo({
		url: `/pages/order/list?type=${type}`
	})
}
</script>

<style lang="scss">
.order-section {
	background-color: #FFFFFF;
	margin: 20rpx;
	padding: 30rpx;
	border-radius: 20rpx;
	box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);

	.section-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 30rpx;
	}

	.title {
		font-size: 32rpx;
		color: #333;
		font-weight: bold;
	}

	.more {
		display: flex;
		align-items: center;

		text {
			font-size: 28rpx;
			color: #999;
		}

		.arrow {
			margin-left: 10rpx;
		}
	}

	.order-types {
		display: flex;
		justify-content: space-between;

		.type-item {
			display: flex;
			flex-direction: column;
			align-items: center;

			.type-icon {
				width: 60rpx;
				height: 60rpx;
				margin-bottom: 10rpx;
			}

			text {
				font-size: 24rpx;
				color: #666;
			}
		}
	}
}
</style>
